# -*- coding:utf-8 -*-
from django.db import models
from django.contrib.auth.models import User


class kao_class_user(models.Model):
    class Meta:
        verbose_name=u'班级用户'
        verbose_name_plural = u'班级用户'

    user=models.OneToOneField(User)
    def __unicode__(self):
        return self.user.username

class kao_class(models.Model):
    class Meta:
        verbose_name=u'班级'
        verbose_name_plural = u'班级'

    create_user=models.ForeignKey(kao_class_user,verbose_name=u'班级创建人')
    class_number=models.CharField(u'班级唯一标识号',max_length=45,blank=False,null=False,unique=True,help_text=u'班级唯一号，用于学生加入此班')
    kao_class_name=models.CharField(u'班级名称',blank=False,null=False,max_length=50,help_text=u'班级名称')
    # clist=models.TextField(u'班级包含学生列表',blank=True,null=True,help_text=u'班级包含的学生列表')
    generate_datetime=models.DateTimeField(u'创建时间',help_text=u'创建时间')

    def __unicode__(self):
        return self.kao_class_name
